package com.kexin.common.user.controller;


import com.kexin.common.exception.WebException;
import com.kexin.common.numeration.ExceptionEnum;
import com.kexin.common.user.entity.UserBase;
import com.kexin.common.utils.Result;
import com.kexin.common.user.service.IUserBaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 用户基本信息表 前端控制器
 * </p>
 *
 * @author chen
 * @since 2021-01-27
 */

@Api(tags = "用户")
@RestController
@RequestMapping("/user/user-base")
public class UserBaseController {

    @Autowired
    private IUserBaseService userBaseService;


    @ApiOperation("获取当前用户信息")
    @PostMapping("/currentUser")
    public Result<UserBase> currentUser(){
        UserBase userBase = userBaseService.getCurrentUser();
        return new Result<UserBase>(userBase);
    }
}
